//Defines the variables for the house
int basis_x, basis_y, kvadrat_xy, basis_x3, basis_x2, slut_y, lilla_1, lilla_2, lilla_3, hvid;

//Definerer værdierne for smiley
int smiley_center_x, smiley_center_y, smiley_r;

//Defines the variables for the sun
float x, y, a, b, c, counter, moon;
//Defines the variables for the human
float ben_x, ben_y, ben_x_2, ben_y_2, hoved_x, hoved_y, arm_x, arm_y, ben_2_x, ben_2_y, ben_2x, ben_2y, krop_x, krop_y, krop_2y, krop_2x, increase;

//Setup
void setup()
{
    size(640, 640);
    frameRate(60);
}


void draw()
{
    background(210, 234, 255);

    //House
    fill(hvid, hvid, hvid);
    basis_x = 30;
    basis_y = 90;
    kvadrat_xy = 150;
    basis_x2 = 180;
    basis_x3 = 105;
    slut_y = 3;
    lilla_1 = 265;
    lilla_2 = 40;
    lilla_3 = 170;
    hvid = 255; //Sætter værdi til variablene for huset
    rect(basis_x, basis_y + 200, kvadrat_xy, kvadrat_xy + 200);
    noFill();
    fill(lilla_1, lilla_2, lilla_3);
    triangle(basis_x, basis_y + 200, basis_x3, slut_y + 200, basis_x2, basis_y + 200);
    noFill();

    //Human
    hoved_x = 330;
    hoved_y = 370;
    ben_x = 330;
    ben_y = 420;
    ben_x_2 = 360;
    ben_y_2 = 460;
    ben_2x = 330;
    ben_2y = 420;
    ben_2_x = 300;
    ben_2_y = 460;
    arm_x = 330;
    arm_y = 420;
    krop_x = 340;
    krop_y = 400;
    krop_2x = 320;
    krop_2y = 400;
    increase = 1;
    fill(hvid, hvid, hvid);
    ellipse(hoved_x, hoved_y, 25, 25);
    noFill();
    line(ben_x, ben_y, ben_x_2, ben_y_2);
    line(ben_2x, ben_2y, ben_2_x, ben_2_y);
    line(hoved_x, hoved_y + 12.5, arm_x, arm_y);
    line(hoved_x, hoved_y + 12.5, krop_x, krop_y);
    line(hoved_x, hoved_y + 12.5, krop_2x, krop_2y);

    //Smiley
    fill(hvid, hvid, hvid);
    smiley_center_x = 105;
    smiley_center_y = 165;
    smiley_r = 145; //Sætter værdi til variablene for smileyen
    ellipse(smiley_center_x, smiley_center_y + 200, smiley_r, smiley_r);
    ellipse(60, 140 + 200, 20, 20);
    ellipse(150, 140 + 200, 20, 20);
    arc(80, 175 + 200, 150, 50, 0, HALF_PI);
    noFill();

    //Earth
    fill(20, 255, 20);
    rect(0, 440, 640, 480);
    noFill();

    //Sun
    a = 0.0009765625;
    b = -0.625;
    c = 180;
    y = a * x * x + b * x + c;
    x = -50 + counter;

    fill(#F7E407);
    ellipse(x, y, 100, 100);
    noFill();
    counter = counter + 2;
    if (counter == 740)
    { //Resets the sun to it's original position
        counter = 0;
    }

}
